package com.suxin.cgib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author Tang
 * @classname MyMethodInterceptor
 * @description [  ]
 * @date 2021/7/19 16:53
 */
public class MyMethodInterceptor implements MethodInterceptor {

    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println(methodProxy);
        System.out.println(method);
        System.out.println("这里是对目标类进行增强！！！");
        return methodProxy.invokeSuper(o, objects);
    }
}